import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import DataModel.Node;
import LogicLayer.DecisionTree;

/**
 * Main app.
 * @author Michal
 *
 */
public class DecisionTreeMain {

	/**
	 * Decision tree
	 */
    public static DecisionTree newTree;
    
	public static void main(String[] args) throws IOException {
		
		// Create instance of class DecisionTree
		Node root = new Node(1,true);
        newTree = new DecisionTree(root);

        // Generate tree
        generateTree();

        // Output tree
        System.out.println("\nOUTPUT DECISION TREE");
        System.out.println("====================");
        newTree.outputBinTree(""+root.id,root);

        System.out.println("\nQUERY DECISION TREE");
        System.out.println("===================");
        newTree.queryBinTree(root);
	}

	/* GENERATE TREE */

    static void generateTree() {
        System.out.println("\nGENERATE DECISION TREE");
        System.out.println("======================");
        
        newTree.addTrueNode(1,2,true);
        newTree.addFalseNode(1,3,false);
        newTree.addTrueNode(2,4,true);
        newTree.addFalseNode(2,5,false);
        newTree.addTrueNode(3,6,true);
        newTree.addFalseNode(3,7,false);
        newTree.addTrueNode(3,8,true);
        newTree.addFalseNode(3,9,false);
        newTree.addTrueNode(4,10,true);
        newTree.addFalseNode(4,11,false);
        newTree.addTrueNode(10,12,true);
        newTree.addFalseNode(10,13,false);
    }
      
}
